package com.huawei.cloud.phone.management.application.user.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.huawei.cloud.phone.management.common.utils.Constants;
import com.huawei.cloud.phone.management.domain.user.User;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor(force = true)
@Data
public class LoginInfoDTO {
    @JsonProperty(Constants.SESSION_ID)
    private String sessionId;

    private String token;

    /**
     * 构造方法
     *
     * @param user 用户信息
     */
    public LoginInfoDTO(User user) {
        this.sessionId = user.getSessionId();
        this.token = user.getToken();
    }
}
